
 
 
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const path =require('path')
const urlLoader = function (conf) {
    return conf.loader === 'url';
  };
/**
 * Sass配置
 * @param {*} config 
 * @param {*} env 
 */
function rewireSass(config, env) {

    config.module.loaders.find(urlLoader).exclude.push(/\.scss$/);

    config.module.loaders.push({
        test: /\.scss$/,
        loader: (env === 'development')
            ? 'style!css!sass'
            : ExtractTextPlugin.extract('style', 'css!sass')
    });

    return config;
}
  
module.exports = function override(config, env) {
    //do stuff with the webpack config...
    config = rewireSass(config, env);
    return config
  }